export const config  = {
    secretKey: 'VCgv1sUs11mKdhX8VeicHitqZ5PVMzOY',
    secretId: 'AKID97qLcfl0JL8fy3uWv62jGZeU5S5WalbC',
    appId: 1251133427 ,
  }

/** 获取签名 start */

function toUint8Array(wordArray) {
    // Shortcuts
    const words = wordArray.words;
    const sigBytes = wordArray.sigBytes;
  
    // Convert
    const u8 = new Uint8Array(sigBytes);
    for (let i = 0; i < sigBytes; i++) {
      u8[i] = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
    }
    return u8;
  }
  
  function Uint8ArrayToString(fileData){
    let dataString = '';
    for (let i = 0; i < fileData.length; i++) {
      dataString += String.fromCharCode(fileData[i]);
    }
    return dataString;
  }
  // 签名函数示例
  export const signCallback = (signStr)=>{ 
    console.log(signStr);
    const secretKey = config.secretKey;
    const hash = window.CryptoJSTest.HmacSHA1(signStr, secretKey);
    const bytes = Uint8ArrayToString(toUint8Array(hash));
    return window.btoa(bytes);
  }
  
  /** 获取签名 end */
  